<table class="box-vang5" cellpadding="0" cellspacing="0" width="100%">
        <tbody><tr class="light">
          <td class="text-top">.:. DANH SÁCH CÔNG VIỆC</td>
        </tr>
      </tbody></table>
      <table class="box-vang5" cellpadding="0" cellspacing="0" width="100%">
        <tbody><tr class="light">
          <td class="t-l"></td>
          <td class="t-c"></td>
          <td class="t-r"></td>
        </tr>
        <tr class="light">
          <td class="c-l"></td>
          <td class="c-c" valign="top">
         
<div class="clear" style="height:10px"></div>

<?php 
	$user=$_SESSION['userid'];
	$role=$_SESSION['room'];
	if($role==2)
	{
				$sqlstring=" 
						select 
							tb_task.task_id,
							tb_task.task_name,
							tb_task.contract_start,
							tb_task.contract_end,
							tb_task.level as mucdo,
							tb_task.brief,
							tb_task.file_attach,
							tb_task.sender,
							tb_task.status,
							tb_task.nguoinhan,
							tb_task.date_creative,
							tb_task.room_id,
							tb_account_admin.account_name
						from 
							tb_task 
							inner join tb_account_admin on tb_task.nguoinhan=tb_account_admin.account_id
						where tb_task.room_id=2 and tb_task.status!=2
						order by 
							tb_task.task_id desc	
						
					";
	}
	if($role==3)
	{
				$sqlstring=" 
						select 
							tb_task.task_id,
							tb_task.task_name,
							tb_task.contract_start,
							tb_task.contract_end,
							tb_task.level as mucdo,
							tb_task.brief,
							tb_task.file_attach,
							tb_task.sender,
							tb_task.status,
							tb_task.nguoinhan,
							tb_task.date_creative,
							tb_task.room_id,
							tb_account_admin.account_name
						from 
							tb_task 
							inner join tb_account_admin on tb_task.nguoinhan=tb_account_admin.account_id
						where tb_task.room_id=3 and tb_task.status!=2
						order by tb_task.task_id desc
						
					";
	}
	if($role==7)
	{
					$sqlstring=" 
						select 
							tb_task.task_id,
							tb_task.task_name,
							tb_task.contract_start,
							tb_task.contract_end,
							tb_task.level as mucdo,
							tb_task.brief,
							tb_task.file_attach,
							tb_task.sender,
							tb_task.status,
							tb_task.nguoinhan,
							tb_task.date_creative,
							tb_task.room_id,
							tb_account_admin.account_name
						from 
							tb_task 
							inner join tb_account_admin on tb_task.nguoinhan=tb_account_admin.account_id
						where tb_task.room_id=7 and tb_task.status!=2
						order by tb_task.task_id desc
						
					";
	}
	if($role==4)
	{
		$sqlstring=" 
						select 
							tb_task.task_id,
							tb_task.task_name,
							tb_task.contract_start,
							tb_task.contract_end,
							tb_task.level as mucdo,
							tb_task.brief,
							tb_task.file_attach,
							tb_task.sender,
							tb_task.status,
							tb_task.nguoinhan,
							tb_task.date_creative,
							tb_account_admin.account_name
						from 
							tb_task 
							inner join tb_account_admin on tb_task.nguoinhan=tb_account_admin.account_id
						where tb_task.status!=2
						order by tb_task.task_id desc
							";
	}
	$sql1=mysql_query($sqlstring);
	$n_record=mysql_num_rows($sql1); 
	$p=$_SESSION['page'];
	$n=$_GET['n'];
	
	
	$sql2=mysql_query($sqlstring);
?>
<table id="box-quick" class="box-quick" border="0" cellpadding="5" cellspacing="0" width="100%">
          <tbody><tr id="title">
            <td width="5%">Mã </td>
            <td width="15%">Tên công việc</td>
            <td width="10%">Người giao</td>
            <td width="10%">Mức độ ưu tiên</td>
            <td width="10%">HĐ bắt đầu</td>
            <td width="10%">HĐ kết thúc</td>
            <td width="10%">Ngày giao việc</td>
            <td width="10%">Giao cho</td>
            <td width="10%">Trạng thái</td>
           
          </tr>
         <?php 
		 	while($row=mysql_fetch_array($sql2))
			{
				
		 ?>
           <tr class="light" id="value" style="cursor:pointer;" onmouseover="mouse_den(this)" onmouseout="mouse_di(this)" bgcolor="">
            <td style="border-left:1px solid #ccc"><div align="center"><?php echo $row['task_id'];?></div></td>
          
            <td  class="tdbg_2" onclick="window.open('index.php?tn=task_detail&id=<?php echo $row['task_id'];?>','_self');"><div align="left">&nbsp;<span>
				<?php echo $row['task_name'];?>
                 </span>
                </div>
            </td>
           <td align="center"><?php echo $row['sender'];?> </td>
            <td>
            	<div align="center" style="color:#090;">
					<?php if($row['mucdo']==1){echo 'Thấp';}?>
                    <?php if($row['mucdo']==2){echo 'Trung bình';}?>
                    <?php if($row['mudo']==2){echo 'Cao';}?>
            	</div>
            </td>
            <td align="center"> <?php echo date('d-m-Y',$row['contract_start']);?></td>
            <td align="center"><?php echo date('d-m-Y',$row['contract_end']);?> </td>
             <td><div align="center">&nbsp;<?php echo date('d-m-Y',$row['date_creative']);?></div></td>
             <td><div align="center">
			 		<?php echo $row['account_name'];?><br />
                 </div>
             </td>
             <td align="center"> 
             	<?php if($row['status']==0){echo '<span style="color:#f00"> Chờ tiếp nhận </span>';}?>
                <?php if($row['status']==1){echo '<span style="color:#09f"> Đang thực hiên </span>';}?>
                <?php if($row['status']==2){echo '<span style="color:blue"> Đã hoàn thành </span>';}?>
             </td>
             
          </tr>
          
         <?php }?>

        </tbody></table>
 		<div style="margin-top:20px;"><?php //view_page('index.php?tn=manager'); ?></div>
 <td class="c-r"></td>
        </tr>
        <tr class="light">
          <td class="b-l"></td>
          <td class="b-c"></td>
          <td class="b-r"></td>
        </tr>
      </tbody></table>